/*
Copyright 2010  Murali Devi (profdevi@gmail.com)

This file is part of ComineGL Project.

ComineGL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ComineGL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ComineGL.  If not, see <http://www.gnu.org/licenses/>.

This code uses the irrlicht and irrklang libraries.  Please read
the libraries copyrights at 

	irrlicht library:  http://irrlicht.sourceforge.net
	irrklang library:  http://www.ambiera.com/irrklang

*/



//v0.16 copyright Comine.com 20110925U21
#ifndef ComineGLInput_h
#define ComineGLInput_h

///////////////////////////////////////////////////
#include "ComineGLDefines.h"

// The following enumeration is copied verbatem from the irrlicht graphics library (keycodes.h)
// The only change is the renaming of the enumeration. Please read copyright for
// the irrlicht library ( http://irrlicht.sourceforge.net )

//////////////////////////////////////////////////
enum ComineGLInputKeyCodes
	{
	CGL_KEY_LBUTTON          = 0x01,  // Left mouse button
	CGL_KEY_RBUTTON          = 0x02,  // Right mouse button
	CGL_KEY_CANCEL           = 0x03,  // Control-break processing
	CGL_KEY_MBUTTON          = 0x04,  // Middle mouse button (three-button mouse)
	CGL_KEY_XBUTTON1         = 0x05,  // Windows 2000/XP: X1 mouse button
	CGL_KEY_XBUTTON2         = 0x06,  // Windows 2000/XP: X2 mouse button
	CGL_KEY_BACK             = 0x08,  // BACKSPACE key
	CGL_KEY_TAB              = 0x09,  // TAB key
	CGL_KEY_CLEAR            = 0x0C,  // CLEAR key
	CGL_KEY_RETURN           = 0x0D,  // ENTER key
	CGL_KEY_SHIFT            = 0x10,  // SHIFT key
	CGL_KEY_CONTROL          = 0x11,  // CTRL key
	CGL_KEY_MENU             = 0x12,  // ALT key
	CGL_KEY_PAUSE            = 0x13,  // PAUSE key
	CGL_KEY_CAPITAL          = 0x14,  // CAPS LOCK key
	CGL_KEY_KANA             = 0x15,  // IME Kana mode
	CGL_KEY_HANGUEL          = 0x15,  // IME Hanguel mode (maintained for compatibility use KEY_HANGUL)
	CGL_KEY_HANGUL           = 0x15,  // IME Hangul mode
	CGL_KEY_JUNJA            = 0x17,  // IME Junja mode
	CGL_KEY_FINAL            = 0x18,  // IME final mode
	CGL_KEY_HANJA            = 0x19,  // IME Hanja mode
	CGL_KEY_KANJI            = 0x19,  // IME Kanji mode
	CGL_KEY_ESCAPE           = 0x1B,  // ESC key
	CGL_KEY_CONVERT          = 0x1C,  // IME convert
	CGL_KEY_NONCONVERT       = 0x1D,  // IME nonconvert
	CGL_KEY_ACCEPT           = 0x1E,  // IME accept
	CGL_KEY_MODECHANGE       = 0x1F,  // IME mode change request
	CGL_KEY_SPACE            = 0x20,  // SPACEBAR
	CGL_KEY_PRIOR            = 0x21,  // PAGE UP key
	CGL_KEY_NEXT             = 0x22,  // PAGE DOWN key
	CGL_KEY_END              = 0x23,  // END key
	CGL_KEY_HOME             = 0x24,  // HOME key
	CGL_KEY_LEFT             = 0x25,  // LEFT ARROW key
	CGL_KEY_UP               = 0x26,  // UP ARROW key
	CGL_KEY_RIGHT            = 0x27,  // RIGHT ARROW key
	CGL_KEY_DOWN             = 0x28,  // DOWN ARROW key
	CGL_KEY_SELECT           = 0x29,  // SELECT key
	CGL_KEY_PRINT			 = 0x2A,  // PRINT key
	CGL_KEY_EXECUT           = 0x2B,  // EXECUTE key
	CGL_KEY_SNAPSHOT         = 0x2C,  // PRINT SCREEN key
	CGL_KEY_INSERT           = 0x2D,  // INS key
	CGL_KEY_DELETE           = 0x2E,  // DEL key
	CGL_KEY_HELP             = 0x2F,  // HELP key
	CGL_KEY_0                = 0x30,  // 0 key
	CGL_KEY_1                = 0x31,  // 1 key
	CGL_KEY_2                = 0x32,  // 2 key
	CGL_KEY_3                = 0x33,  // 3 key
	CGL_KEY_4                = 0x34,  // 4 key
	CGL_KEY_5                = 0x35,  // 5 key
	CGL_KEY_6                = 0x36,  // 6 key
	CGL_KEY_7                = 0x37,  // 7 key
	CGL_KEY_8                = 0x38,  // 8 key
	CGL_KEY_9                = 0x39,  // 9 key
	CGL_KEY_A                = 0x41,  // A key
	CGL_KEY_B                = 0x42,  // B key
	CGL_KEY_C                = 0x43,  // C key
	CGL_KEY_D                = 0x44,  // D key
	CGL_KEY_E                = 0x45,  // E key
	CGL_KEY_F                = 0x46,  // F key
	CGL_KEY_G                = 0x47,  // G key
	CGL_KEY_H                = 0x48,  // H key
	CGL_KEY_I                = 0x49,  // I key
	CGL_KEY_J                = 0x4A,  // J key
	CGL_KEY_K                = 0x4B,  // K key
	CGL_KEY_L                = 0x4C,  // L key
	CGL_KEY_M                = 0x4D,  // M key
	CGL_KEY_N                = 0x4E,  // N key
	CGL_KEY_O                = 0x4F,  // O key
	CGL_KEY_P                = 0x50,  // P key
	CGL_KEY_Q                = 0x51,  // Q key
	CGL_KEY_R                = 0x52,  // R key
	CGL_KEY_S                = 0x53,  // S key
	CGL_KEY_T                = 0x54,  // T key
	CGL_KEY_U                = 0x55,  // U key
	CGL_KEY_V                = 0x56,  // V key
	CGL_KEY_W                = 0x57,  // W key
	CGL_KEY_X                = 0x58,  // X key
	CGL_KEY_Y                = 0x59,  // Y key
	CGL_KEY_Z                = 0x5A,  // Z key
	CGL_KEY_LWIN             = 0x5B,  // Left Windows key (Microsoft Natural keyboard)
	CGL_KEY_RWIN             = 0x5C,  // Right Windows key (Natural keyboard)
	CGL_KEY_APPS             = 0x5D,  // Applications key (Natural keyboard)
	CGL_KEY_SLEEP            = 0x5F,  // Computer Sleep key
	CGL_KEY_NUMPAD0          = 0x60,  // Numeric keypad 0 key
	CGL_KEY_NUMPAD1          = 0x61,  // Numeric keypad 1 key
	CGL_KEY_NUMPAD2          = 0x62,  // Numeric keypad 2 key
	CGL_KEY_NUMPAD3          = 0x63,  // Numeric keypad 3 key
	CGL_KEY_NUMPAD4          = 0x64,  // Numeric keypad 4 key
	CGL_KEY_NUMPAD5          = 0x65,  // Numeric keypad 5 key
	CGL_KEY_NUMPAD6          = 0x66,  // Numeric keypad 6 key
	CGL_KEY_NUMPAD7          = 0x67,  // Numeric keypad 7 key
	CGL_KEY_NUMPAD8          = 0x68,  // Numeric keypad 8 key
	CGL_KEY_NUMPAD9          = 0x69,  // Numeric keypad 9 key
	CGL_KEY_MULTIPLY         = 0x6A,  // Multiply key
	CGL_KEY_ADD              = 0x6B,  // Add key
	CGL_KEY_SEPARATOR        = 0x6C,  // Separator key
	CGL_KEY_SUBTRACT         = 0x6D,  // Subtract key
	CGL_KEY_DECIMAL          = 0x6E,  // Decimal key
	CGL_KEY_DIVIDE           = 0x6F,  // Divide key
	CGL_KEY_F1               = 0x70,  // F1 key
	CGL_KEY_F2               = 0x71,  // F2 key
	CGL_KEY_F3               = 0x72,  // F3 key
	CGL_KEY_F4               = 0x73,  // F4 key
	CGL_KEY_F5               = 0x74,  // F5 key
	CGL_KEY_F6               = 0x75,  // F6 key
	CGL_KEY_F7               = 0x76,  // F7 key
	CGL_KEY_F8               = 0x77,  // F8 key
	CGL_KEY_F9               = 0x78,  // F9 key
	CGL_KEY_F10              = 0x79,  // F10 key
	CGL_KEY_F11              = 0x7A,  // F11 key
	CGL_KEY_F12              = 0x7B,  // F12 key
	CGL_KEY_F13              = 0x7C,  // F13 key
	CGL_KEY_F14              = 0x7D,  // F14 key
	CGL_KEY_F15              = 0x7E,  // F15 key
	CGL_KEY_F16              = 0x7F,  // F16 key
	CGL_KEY_F17              = 0x80,  // F17 key
	CGL_KEY_F18              = 0x81,  // F18 key
	CGL_KEY_F19              = 0x82,  // F19 key
	CGL_KEY_F20              = 0x83,  // F20 key
	CGL_KEY_F21              = 0x84,  // F21 key
	CGL_KEY_F22              = 0x85,  // F22 key
	CGL_KEY_F23              = 0x86,  // F23 key
	CGL_KEY_F24              = 0x87,  // F24 key
	CGL_KEY_NUMLOCK          = 0x90,  // NUM LOCK key
	CGL_KEY_SCROLL           = 0x91,  // SCROLL LOCK key
	CGL_KEY_LSHIFT           = 0xA0,  // Left SHIFT key
	CGL_KEY_RSHIFT           = 0xA1,  // Right SHIFT key
	CGL_KEY_LCONTROL         = 0xA2,  // Left CONTROL key
	CGL_KEY_RCONTROL         = 0xA3,  // Right CONTROL key
	CGL_KEY_LMENU            = 0xA4,  // Left MENU key
	CGL_KEY_RMENU            = 0xA5,  // Right MENU key
	CGL_KEY_PLUS             = 0xBB,  // Plus Key   (+)
	CGL_KEY_COMMA            = 0xBC,  // Comma Key  (,)
	CGL_KEY_MINUS            = 0xBD,  // Minus Key  (-)
	CGL_KEY_PERIOD           = 0xBE,  // Period Key (.)
	CGL_KEY_ATTN             = 0xF6,  // Attn key
	CGL_KEY_CRSEL            = 0xF7,  // CrSel key
	CGL_KEY_EXSEL            = 0xF8,  // ExSel key
	CGL_KEY_EREOF            = 0xF9,  // Erase EOF key
	CGL_KEY_PLAY             = 0xFA,  // Play key
	CGL_KEY_ZOOM             = 0xFB,  // Zoom key
	CGL_KEY_PA1              = 0xFD,  // PA1 key
	CGL_KEY_OEM_CLEAR        = 0xFE,   // Clear key
	};


//////////////////////////////////////////////////////////
MDLLFUN bool CGLKeyIsPressed(enum ComineGLInputKeyCodes keycode);
MDLLFUN bool CGLMouseGetPosition(int &x,int &y);
MDLLFUN bool CGLMouseGetDeltaPosition(int &dx,int &dy);
MDLLFUN bool CGLMouseIsLeftPressed(void);
MDLLFUN bool CGLMouseIsRightPressed(void);

///////////////////////////////////////////////////////
// Offer Overloaded functions for User
inline bool CGLKeyIsPressed(int keycode)
	{
	return CGLKeyIsPressed(ComineGLInputKeyCodes(keycode) );
	}

#endif // ComineGLInput_h
